package com.cms.setting.friendlink.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cms.setting.friendlink.dao.FriendCatDAO;
import com.cms.setting.friendlink.pojo.FriendCat;
import com.cms.setting.friendlink.service.FriendCatService;
@Service
public class FriendCatServiceImp implements FriendCatService {
	@Autowired
	FriendCatDAO friendCatDAO;
	@Override
	public boolean saveFriendCat(FriendCat friendCat) {
		boolean falg=false;
		if(friendCat.getId()!=null){
			falg=friendCatDAO.updateByPrimaryKey(friendCat)>0;
		}else{
			falg=friendCatDAO.insert(friendCat)>0;
		}
		return falg;
	}

	@Override
	public boolean deleteByCatId(Integer catId) {
		return friendCatDAO.deleteByPrimaryKey(catId)>0;
	}

	@Override
	public FriendCat findByCatId(Integer catId) {
		return friendCatDAO.selectByPrimaryKey(catId);
	}

	@Override
	public List<FriendCat> findList() {
		List<FriendCat> friendcatall=friendCatDAO.findRecordAll();
		return friendcatall;
	}

}
